/* 
	该文件专门用于暴露一个store对象，整个应用只有一个store对象
*/
import { createStore } from 'redux'
//引入redux-thunk，用于支持异步action
// import thunk from 'redux-thunk'
//引入汇总之后的reducer
import reducer from './reducers/index'

import { persistStore, persistReducer } from 'redux-persist'
import storage from 'redux-persist/lib/storage' // defaults to localStorage for web

const persistConfig = {
  key: 'root',
  storage,
  blacklist: ['LodingReducer'] // 黑名单，这里的不持久化
}
const persistedReducer = persistReducer(persistConfig, reducer)


 let store = createStore(persistedReducer)
let persistor = persistStore(store)
// import {composeWithDevTools} from 'redux-devtools-extension'


//暴露store 
export {
  store,
  persistor
}